/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hu
 * Date: 2024-04-25
 * Time: 19:15
 */
import java.util.Scanner;
import java.util.Random;
public class Test {
    public static void main(String[] args) {
        Random random = new Random();
        Scanner sc = new Scanner(System.in);
        int toGuess = random.nextInt(100);
        while (true) {
            System.out.println("输入想要输入的数");
            int num = sc.nextInt();
            if(num < toGuess){
                System.out.println("猜小了");
            }else if(num > toGuess){
                System.out.println("猜大了");
            }else{
                System.out.println("猜对了");
                System.out.println();
                break;
            }
        }
        sc.close();

    }
    public static void main1(String[] args) {
        Scanner sc = new Scanner(System.in);
        int sum = 0;
        int num = 0;
        while(sc.hasNextInt()){
            int tmp = sc.nextInt();
            sum += tmp;
            num++;
        }
        System.out.println("sum = "+ sum);
        System.out.println("avg = "+ sum / num);
        sc.close();
    }
}

